]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Add function to close the calendar
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Feb 2015 09:44:13 +0000 (10:44 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 20 Feb 2015 16:37:00 +0000 (17:37 +0100)
We will soon replace regular menu items in the calendar drop-down
with more complex elements.
However there will still be items that should close the drop down
when activated - rather than making the menu available throughout
the hierarchy (and eventually from outside as well when we add the
notifications list), have a public method on a global object just
like the ubiquitous Main.overview.hide().

https://bugzilla.gnome.org/show_bug.cgi?id=744817

js/ui/panel.js

index eadf399fa163009daef285b1c82018bdd2f66355..df67e2bf1929ebcaa1a19b37ae1e3283e8787278 100644 (file)
@@ -891,6 +891,18 @@ const Panel = new Lang.Class({
             menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
     },
 
+    closeCalendar: function() {
+        let indicator = this.statusArea.dateMenu;
+        if (!indicator) // calendar not supported by current session mode
+            return;
+
+        let menu = indicator.menu;
+        if (!indicator.actor.reactive)
+            return;
+
+        menu.close();
+    },
+
     set boxOpacity(value) {
         let isReactive = value > 0;